{% extends "../layout.html" %}

{% block content %}
<div class="dy-wrapper">
  <form action="{{ url }}" method="post" class="needs-validation" novalidate>
    <div class="row mb-3">
      <label for="name" class="col-sm-2 col-form-label text-end">名称</label>
      <div class="col-sm-10 position-relative">
        <input type="text" class="form-control" id="name" name="name" value="{{ data.name }}" placeholder="请输入名称" required />
        <div class="invalid-tooltip">名称必须填写</div>
      </div>
    </div>
    <div class="row mb-3">
      <label for="image" class="col-sm-2 col-form-label text-end">图片</label>
      <div class="col-sm-10">
        <div class="upload_res" id="uploadRes"><input type="hidden" id="image" name="image" value="{{ data.image }}"/></div>
        <div class="upload-form">
          <div class="position-relative upload-action">
            <span class="fa fa-cloud-upload fs-3"></span>
            <input type="file" class="position-absolute form-control file_upload" id="upload" name="upload" />
          </div>
          <div class="mt-2 img">
            <div class="img show_img" id="showimg">
              {% if data.image != "" %}
              <img src="{{ data.image }}" alt="" height="100" />
              {% endif %}
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="row mb-3">
      <label for="order_by" class="col-sm-2 col-form-label text-end">排序</label>
      <div class="col-sm-10">
        <input type="number" class="form-control" id="order_by" name="order_by" value="{{ data.order_by }}" placeholder="请输入排序" />
      </div>
    </div>
    
    <div class="row mb-3">
        <label class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
            <button type="submit" class="btn btn-sky-blue">保存</button>
        </div>
    </div>
  </form>
</div>
{% endblock %}